<?php

namespace App\models;

use Illuminate\Database\Eloquent\Model;

class Role extends Model
{
    //模型关联的数据表 role
    protected $table = 'role';

    //模型关联的数据表的主键
    public $primaryKey = 'id';

   //不关联表中允许比例操作的字段
   	public $guarded = [];

   	//关闭create_at update_at自维护功能
   	public $timestamps = false;

   	public function permission(){
        return $this->belongsToMany('App\models\Permission', 'permission_role', 'rid', 'pid');
    }
}
